public class Code1 {
    public static void main(String[] args) {
        String str = "NIwOUy";
        toChange(str);
        //System.out.println(String.valueOf('/').toLowerCase());
    }
    public static void toChange(String str) {
        StringBuffer stringBuffer = new StringBuffer();
        for (int i = str.length() - 1; i >= 0; i--) {
            char ch = str.charAt(i);
            if (ch >= 'A' && ch <= 'Z') {
                stringBuffer.append(String.valueOf(ch).toLowerCase());
            } else {
                stringBuffer.append(String.valueOf(ch).toUpperCase());
            }
        }
        System.out.println(stringBuffer.toString());
    }
}
